package day02;

public class homeworkwhile01 {
    public static void main(String[] args) {
       int sum = sum_while();
        System.out.println("1~100内奇数的和是"+sum);
    }

    public static int sum_while() {
        int i=1;
        int sum1 =0;
        while(i<=100){
            if(i%2!=0){
                sum1 += i;
            }
            i++;
        }
        return sum1;
    }
}
